/**
 * @file       GBKSaxHandler.cc
 * @brief      
 * @author     LiuJkun
 * @version    1.0.0
 */

/*********************************************************************
 *  LiuJikun   01/28/10      Initial Version
 *********************************************************************/
#include	"GBKSaxHandler.h"
namespace XMLCC {
    namespace SAX{ 
        /**
         * @brief  constructor for class GBKSaxHandler
         */
        //--------------------------------------------------------------------------------------
        GBKSaxHandler::GBKSaxHandler ( void )
        {
        }


        /**
         * @brief  constructor for class GBKSaxHandler
         */
        //--------------------------------------------------------------------------------------
        GBKSaxHandler::~GBKSaxHandler ( void )
        {
        }
        /**
         * @brief 
         * @return
         */
        void  GBKSaxHandler::startDocument ( void )
        {
            printf ( "----------\n" );
            return ;
        }		

        /**
         * @brief 
         * @return
         */
        void  GBKSaxHandler::startObject ( Object *object )
        {
            String tag = object->getString( );
            std::cout << "start object: " << "\t" << tag << std::flush << std::endl;

            int noOfAttributes = object->getNoOfObjects( );
            for( int a = 0; a < noOfAttributes; a++ ) {
                Object* oAtt = object->getObject( a );
                String att = oAtt->getString( );
                std::cout << "attribute: " << "\t" << att << std::flush << std::endl;
            } // a
            return ;
        }		

        /**
         * @brief 
         * @return
         */
        void GBKSaxHandler::characters ( Object *object )
        {
            printf ( "characters obj...\n" );
            String value = object->getString( );
            std::cout << "object value: " << "\t" << value << std::flush << std::endl;
            return ;
        }		

        /**
         * @brief 
         * @return
         */
        void GBKSaxHandler::endDocument ( void )
        {
            return ;
        }		

        /**
         * @brief 
         * @return
         */
//        void GBKSaxHandler::cdata ( Object *obj )
//        {
//            printf ( "characters obj...\n" );
//            //    printf ( "%s\n", obj->getString().c_str() );
//            return ;
//        }		

        /**
         * @brief 
         * @return
         */
        void GBKSaxHandler::endObject ( Object *obj )
        {
            printf ( "end obj......\n" );
            return ;
        }		
    }
}
